<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link type="text/css" href="../css/redmond/jquery-ui-1.8.18.custom.css" rel="stylesheet" />	
	<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="../js/jquery-ui-1.8.18.custom.min.js"></script>
	<script type="text/javascript">
	$(function() {
		$("#button").click(function(){
			$.getJSON("../common/validateCodeAction!checkCode.jspa",{code: $("#code").val() }, function(json){
				if(true){
					$("form").submit();			
				}else{
					alert("验证码错误");
				}
			});
		});
	});
	</script>
	<title>Insert title here</title>
</head>
<body>
	<s:form action="userAction!insertUser.jspa" namespace="/com">
		<s:textfield name="username"></s:textfield>
		<s:textfield name="password"></s:textfield>
		<s:textfield name="name"></s:textfield>
		<s:select name="role" list="#{1:'系统',2:'总经理',3:'内勤',4:'导游'}"></s:select>
		<img alt="验证码" src="../common/validateCodeAction!execute.jspa">
		<s:textfield id="code" name="code"></s:textfield>
	</s:form>
	<input id="button" type="button" value="提交"/>
</body>
</html>